<template>
  <div id="app">
    <router-view />
  </div>
</template>
<script>
import axios from "axios";
const service = axios.create({
  // timeout: 30000, // request timeout
});
export default {
  name: "app",
  data() {
    return {};
  },
  components: {},
  created() {
    // console.log(window.navigator.userAgent.replace(/[^\w]/gi, ''))
    // this.test();
    if (process.env.NODE_ENV === 'production') {
      this.isWeiXin() 
    }
    // 
  },
  methods: {
    isWeiXin() { 
      var ua = window.navigator.userAgent.toLowerCase();
      if (ua.match(/MicroMessenger/i) != "micromessenger") {
        this.$router.push("/404");
      }
    },
    test() {
      console.time();
      service
        .post("https://spaq.suzhou.gov.cn/test-ssa-rcjg-api/RCJD/supunit", {
          identify: "91320507MA1WULAL4U",
          lic: "苏州市相融酒店管理有限公司在水一方大酒店",
          token:
            "Op9t7RKh8*rmnuaVPOiHfx5KLMWn$EeDZ*j6pderrWuZ5o5oWH8QKbligiyWgotL",
        })
        .then((res) => {
          console.timeEnd();
          setTimeout(() => {
            this.test();
          }, 10000);
        })
        .catch((err) => {
          console.timeEnd();
          setTimeout(() => {
            this.test();
          }, 10000);
        });
    },
  },
};
</script>
<style>
</style>
